package filedemo;

public class Main7 {
    public static void main(String[] args) {
        try {
            java.io.File fileToChange = new java.io.File("C:/myjavafile.txt");
            fileToChange.createNewFile();
            java.util.Date filetime = new java.util.Date(fileToChange.lastModified());
            System.out.println(filetime);
            System.out.println(fileToChange.setLastModified(System.currentTimeMillis()));
            filetime = new java.util.Date(fileToChange.lastModified());
            System.out.println(filetime);
        } catch (java.io.IOException e) {
            throw new RuntimeException(e);
        }
    }
}
